package com.itheima.service.impl;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.itheima.mapper.OperateLogMapper;
import com.itheima.pojo.OperateLog;
import com.itheima.pojo.PageResult;
import com.itheima.service.LogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @Author：cxl
 * @Package：com.itheima.service.impl
 * @Project：web-project
 * @name：LogServiceImpl
 * @Date：2025/10/7 21:10
 * @Filename：LogServiceImpl
 */
@Service
public class LogServiceImpl implements LogService {
    @Autowired
    private OperateLogMapper operateLogMapper;

    @Override
    public PageResult<OperateLog> page(Integer page, Integer pageSize) {
        PageHelper.startPage(page, pageSize);
        Page<OperateLog> logPage = operateLogMapper.page();
        return new PageResult<>(logPage.getTotal(), logPage.getResult());
    }
}
